package com.example.ylgh.controller;

import com.example.result.Result;
import com.example.ylgh.service.DepartmentService;
import com.example.ylgh.vo.hosp.DepartmentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author hx
 * @create 2022/5/13 13:28
 * description:
 */
@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;


    /**
     * 根据医院节点，查询医院所有科室列表
     * @param hoscode
     * @return
     */
    @GetMapping("/getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> list =departmentService.findDepTree(hoscode);
        return Result.ok(list);
    }
}
